package com.ian.departmentmanager.service.Impl;

import java.util.List;

import com.ian.departmentmanager.bo.Member;
import com.ian.departmentmanager.dao.MemberDao;
import com.ian.departmentmanager.service.MemberService;

public class MemberServiceImpl implements MemberService {

	private MemberDao memberDao;

	public void setMemberDao(MemberDao memberDao) {
		this.memberDao = memberDao;
	}

	/**
	 * get members
	 * 
	 */
	@Override
	public List<Member> getMembers() {
		List<Member> members = memberDao.getMembers();
		return members;
	}

	@Override
	public void delMember(int Id) {
		memberDao.delMember(Id);

	}

	@Override
	public Member getMember(int Id) {
		Member mem = memberDao.getMember(Id);
		return mem;
	}

	@Override
	public void updateMember(int Id, String stuName, String stuID,
			String profession, String contact, String email) {
		memberDao.updateMember(Id, stuName, stuID, profession, contact, email);

	}

	@Override
	public void addMember(String stuName, String stuID, String profession,
			String contact, String email) {
		Member mem = new Member();
		mem.setStuName(stuName);
		mem.setStuID(stuID);
		mem.setProfession(profession);
		mem.setContact(contact);
		mem.setEmail(email);
		memberDao.insertMember(mem);

	}

}
